<?php
/**
 * Created by PhpStorm.
 * Author: wxy
 * Date: 2023/5/09
 * Time: 12:01
 */

namespace App\backend\models;


use App\common\models\BaseModel;
use Illuminate\Support\Facades\DB;

/**
 * Class AdminRoleUsersModel
 * @package app\backend\models
 */
class AdminRoleUsersModel extends BaseModel
{
    const table = 'admin_role_users';

    public function __construct() {

    }

    /**
     * 数据库 - 更新数据
     * @param $userId   //操作员ID
     * @param $data //参数数组
     * @return array
     */
    static public function updatedData($userId, $data)
    {
        $data = DB::table(self::table)
            ->where('user_id','=', $userId)
            ->update($data);

        return $data;
    }

    /**
     * 数据库 - 插入数据
     * @param $data //参数数组
     * @return array
     */
    static public function insertData($data)
    {
        $data = DB::table(self::table)->insert($data);
        return $data;
    }

}
